package com.ldl.exam.dao;

import com.ldl.exam.entity.ExamPaper;
import com.ldl.exam.entity.ExamPaperDetail;
import com.ldl.exam.entity.ExamPaperDetailExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ExamPaperDetailMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ExamPaperDetail record);

    int insertSelective(ExamPaperDetail record);

    List<ExamPaperDetail> selectByExample(ExamPaperDetailExample example);

    ExamPaperDetail selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ExamPaperDetail record);

    int updateByPrimaryKey(ExamPaperDetail record);

    int insertExamPaperIdAndQuestionId(@Param("examPaperId") Integer examPaperId, @Param("questionId") Integer questionId);

    int deleteByExamPaperIdAndQuestionId(@Param("examPaperId") Integer examPaperId, @Param("questionId") Integer questionId);

    /**
     * 查询试卷的题目数量
     * @param examPaperId
     * @return int
     */
    int selectQuestionsCountByExamPaperId(@Param("examPaperId") Integer examPaperId);

}